<template>
  <div class="answer">
    <el-button @click="submit">提交</el-button>
    <div class="title-wrap">
      <Editable class="title" v-model="data.title"></Editable>
      <Editable class="sub-title" v-model="data.subTitle"></Editable>
    </div>
    <Question
      v-for="(element, index) in data.data"
      :key="index"
      :data="element"
      :index="index + 1"
    ></Question>
  </div>
</template>

<script setup lang="ts">
import Question from '@/components/Question.vue'

const props = defineProps({
  data: {
    type: Object,
    required: true
  }
})
const submit = () => {
  console.log(props.data)
}
</script>

<style scoped></style>
